{/* LAYOUT模板 */}
	<layout name="layout"/>
{/* LAYOUT模板 */}

{/* import Js,Css */}
	<js href="__PUBLIC__/js/admin/listTable.js"/>
	<js href="__PUBLIC__/js/admin/js.util.js"/>
	<css href="__PUBLIC__/css/admin/common.css"/>
	<js href="__PUBLIC__/js/admin/js.selectzone.js"/>
	
	<css href="__PUBLIC__/css/jquery-ui.css" />
	<js href="__PUBLIC__/js/core/jquery-ui.1.10.4.js" />
	<js href="__PUBLIC__/js/core/plugins.js"/>
{/* import js,css */}

<!-- [position] -->
	<include file="Template:position"/>
<!-- [position] -->

<div class="main-div">
	<form method="post" action="__URL__/{$action}" name="theForm" enctype="multipart/form-data" onsubmit="return validate()">
		<table cellspacing="1" cellpadding="3" width="100%">
			<tr>
				<td class="label" align="right">商品包装名称</td>
				<td>
					<input type="text" name="pack_name" maxlength="60" size = "30" value="{$pack.pack_name}" />*
				</td>
			</tr>
			<tr>
				<td class="label" align="right">
					<a href="javascript:showNotice('notice_packfee');" title="{$lang.form_notice}">
						<img src="__PUBLIC__/Image/admin/notice.gif" width="16" height="16" border="0" alt="{$lang.form_notice}">
					</a>
					费用
				</td>
				<td>
					<input type="text" name="pack_fee" maxlength="60" size="30" value="{$pack.pack_fee}" />
					*
					<br/>
					<span class="notice-span" <if condition="$help_open">style="display:block"<else/>style="display:none"</if> id="notice_packfee">
						使用这个包装所需要支付的费用，免费时设置为0
					</span>
				</td>
			</tr>
			<tr>
				<td class="label" align="right">
					<a href="javascript:showNotice('notice_freemoney');" title="{$lang.form_notice}">
						<img src="__PUBLIC__/Image/admin/notice.gif" width="16" height="16" border="0" alt="{$lang.form_notice}">
					</a>
					免费额度
				</td>
				<td>
					<input type="text" name="free_money" maxlength="60" size="30" value="{$pack.free_money}" />*
					<br/>
					<span class="notice-span" <if condition="$help_open">style="display:block"<else/>style="display:none"</if> id="notice_freemoney">
						当用户消费金额超过这个值时，将免费使用这个包装。
						设置为0时表明必须支付包装费用
					</span>
				</td>
			</tr>
			<tr>
				<td class="label" align="right">
					<if condition="$pack['pack_img'] neq ''">
						<a href="javascript:showNotice('warn_packimg');" title="{$lang.form_notice}">
							<img src="__PUBLIC__/Image/admin/warning_small.gif" width="16" height="16" border="0" alt="{$lang.form_notice}">
						</a>
					</if>
					包装图纸
				</td>
				<td>
					<input type="file" name="pack_img"  size="45">
					<if condition="$pack['pack_img'] neq ''">
						<input type="button" value="删除包装图纸" onclick="if (confirm('你确定要删除贺卡图纸吗?'))location.href='pack.php?act=drop_pack_img&id={$pack.pack_id}'">
					</if>
					<br/>
					<span class="notice-span" <if condition="$help_open">style="display:block"<else/>style="display:none"</if> id="warn_packimg">
						你已经上传过图片。再次上传时将覆盖原图片
					</span>
				</td>
			</tr>
			<tr>
				<td class="label" align="right">包装描述</td>
				<td>
					<textarea  name="pack_desc" cols="60" rows="4">{$pack.pack_desc}</textarea>
				</td>
			</tr>
			<tr>
				<td>&nbsp;</td>
				<td>
				<input type="submit" value="确定" />
				<input type="reset" value="重置" />
				<input type="hidden" name="act" value="{$form_action}" />
				<input type="hidden" name="id" value="{$pack.pack_id}" />
				<input type="hidden" name="old_packname" value="{$pack.pack_name}" />
				<input type="hidden" name="old_packimg" value="{$pack.pack_img}">
				</td>
			</tr>
		</table>
	</form>
</div>

<script language="JavaScript">
	document.forms['theForm'].elements['pack_name'].focus();
	/**
	 * 检查表单输入的数据
	 */
	function validate(){
	  validator = new Validator("theForm");
	  validator.required("pack_name",  no_packname);
	  validator.isNumber("pack_fee",   packfee_un_num, 1);
	  validator.isNumber("free_money", packmoney_un_num, 1);
	  return validator.passed();
	}

	onload = function(){
		// 开始检查订单
		startCheckOrder();
	}
</script>